<?php
class UserAction extends FrontendAction
{
	public function __construct()
	{
		parent::__construct();
		$this->data['menu']	= 'user';
	}
	
	public function beforeExecute()
	{
		parent::beforeExecute();
		if(!is_numeric($this->data['user']['id']) || $this->data['user']['id']<0)
		{
			if($this->responseType == 'json')
			{
				echo json_encode(array('forward'=>C('LtUrl')->generate('User','Login')));
				exit;
			}
			else
			{
				header('Location:'.C('LtUrl')->generate('User','Login'));
			}
		}
		
		$this->data['is_master'] = true;
		$this->data['master'] = $this->data['user'];
		
	}
	
}